<?php 
	set_time_limit(0);
	include("config.php");
    include(INCLUDEDIR."core.php");
	include(INCLUDEDIR."dompdf/dompdf_config.inc.php");
	include("acceso.php");
	
	$tpl = new PDF();
	$tpl->setTitulo("usuarios_".date("Ymd"));


	$query = "	SELECT * FROM personas 
				LEFT JOIN institutos ON personas.id_instituto = institutos.id_instituto			
				WHERE personas.es_dondeaprendo = '1' ORDER BY nombre_persona ASC";
	
	$result = mysql_query($query);
	
	$tpl->newBlock("LISTAPERSONAS");
	$tpl->assign("fecha",date("d-m-Y"));
	if($result && mysql_num_rows($result)>0) {
		while($fila = mysql_fetch_assoc($result)) {
			$tpl->newBlock("FILAPERSONA");
			foreach($fila as $k => $v) $tpl->assign($k,$v);
			$tpl->assign("tipo_persona",$fila['es_profesor']==1?"PROF":"EST");
		}
	}
	
	
	//echo $tpl->getContent();
	//exit();
	$tpl->setDownload();
?>